package com.easyedu.student.controller;

import com.easyedu.core.entity.po.Institute;
import com.easyedu.core.util.R;
import com.easyedu.student.service.InstituteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lmr </br>
 * 查询学院
 **/
@RestController
@RequestMapping("/student")
public class InstituteController {

    private final InstituteService instituteService;

    public InstituteController(InstituteService instituteService) {
        this.instituteService = instituteService;
    }

    /**
     * 功能描述：所有学院信息
     *
     * @return
     */
    @GetMapping("/institute")
    public R getInstitute() {
        List<Institute> institute = instituteService.getInstitute();
        return R.ok().data(institute);
    }
}
